package com.ztesoft.ossup.report.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.ztesoft.ossup.report.domain.ReportConditionEnum;

public interface ConditionEnumRepository extends JpaRepository<ReportConditionEnum,Long>,JpaSpecificationExecutor<ReportConditionEnum>{

	@Query(value = "delete from REPORT_CONDITION_ENUM where stype = ?1 ", nativeQuery = true)
    @Modifying
    public void deleteByStype(String stype);

	@Query(value = "update REPORT_CONDITION_ENUM set NAME = ?1 where STYPE = ?2", nativeQuery = true)
    @Modifying
	public void updateBySTYPE(String name,String  stype);

	@Query(value = "update REPORT_CONDITION_ENUM set NAME = ?1 where STYPE = ?2", nativeQuery = true)
    @Modifying
	public ReportConditionEnum findConditonEnumByStype(String stype);
}

